import Cookies from 'js-cookie'

const TokenKey = 'vue_admin_template_token' // 存储token

const timeKey = 'hrsaas-timestamp-key1212121212' //  存储token获取到时间戳的key

// 从cookies中获取token存储的时间戳
export function getTimeStamp() {
  return Cookies.get(timeKey)
}
// 存储获取到token时的时间戳
export function setTimeStamp() {
  return Cookies.set(timeKey, Date.now())
}
// 从cookies中获取token
export function getToken() {
  return Cookies.get(TokenKey)
}

// 存储token到cookie中
export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

// 将token从cookie删除
export function removeToken() {
  return Cookies.remove(TokenKey)
}
